{
  description = "Description for the project";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
    denv = {
      url = "github:iliayar/env.nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    tree-sitter-cangjie-src = {
      url = "git+https://gitcode.com/Cangjie-SIG/tree-sitter-cangjie.git";
      flake = false;
    };
  };

  outputs = inputs@{ flake-parts, denv, tree-sitter-cangjie-src, ... }:
    flake-parts.lib.mkFlake { inputs = denv.inputs; } {
      imports = [ denv.flakeModules.default ];
      systems =
        [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
      perSystem = { config, self', inputs', pkgs, system, ... }: 
      let 
        cangjie-nvim = pkgs.vimUtils.buildVimPlugin {
            pname = "cangjie.nvim";
            version = "1.0.0";
            src = ./.;

            postInstall = ''
                mkdir -p $out/queries/cangjie
                cp ${tree-sitter-cangjie-src}/queries/* $out/queries/cangjie/
            '';
        };

        tree-sitter-cangjie = pkgs.tree-sitter.buildGrammar {
            language = "cangjie";
            version = "1.0.0";
            src = tree-sitter-cangjie-src;
        };
      in {
        denvs.default = { denv.packages = with pkgs; [ ]; };

        packages = rec {
            inherit cangjie-nvim tree-sitter-cangjie;
            default = cangjie-nvim;
        };
      };
      flake = { };
    };
}
